﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MSBDATAModel;

public partial class KHCapNhatTaiKhoan : System.Web.UI.Page
{
    MSBDATAEntities entities = new MSBDATAEntities();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login"] == null)
        {
            Response.Redirect("NotLogin.aspx");
        }
        else if (!IsPostBack)
        {
            string loginUserName = Session["login"].ToString();
            var caches = from t in entities.TAI_KHOAN_WEB
                         where t.TenDangNhap == loginUserName
                         select t;
            try {
                TAI_KHOAN_WEB tk = caches.First();
                this.KHThongTinTaiKhoan1.SetThongTinTaiKhoan(tk,true);
            }
            catch (Exception) {
                Response.Redirect("NotLogin.aspx");
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        var caches = from t in entities.TAI_KHOAN_WEB
                     where t.TenDangNhap == Session["login"].ToString()
                     select t;
        try
        {
            TAI_KHOAN_WEB tk = caches.First();
            
        }
        catch (Exception)
        {
            Response.Redirect("NotLogin.aspx");
        }
    }
}